package edu.upc.clase.demo.service.impl;

import edu.upc.clase.demo.dao.ReservaDao;
import edu.upc.clase.demo.dao.impl.ReservaDaoImpl;
import edu.upc.clase.demo.entity.Reserva;
import edu.upc.clase.demo.service.ReservaServices;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author 
 *
 */
@Service
public class ReservaServiceImpl implements ReservaServices{
    private static Logger log = LoggerFactory.getLogger(ReservaDaoImpl.class);
    
    @Autowired
    private ReservaDao reservaDao;
    
    @Override
    public Integer registrarReserva(Reserva objReserva){
        try{
                log.info("REGISTRANDO CORRECTAMENTE");
                return reservaDao.registrarReserva(objReserva);
            
        }catch(ExceptionInInitializerError e){
            return null;
        }
    }
    
    @Override
    public void modificarReserva(Reserva objReserva){
        log.info("MODIFICANDO");
        reservaDao.modificarReserva(objReserva);
    }
    
    @Override
    public void eliminarReserva(Integer idReserva){
        log.info("ELIMINANDO");
    }
    
    @Override
    public List<Reserva> buscarTodos(){
        return reservaDao.buscarTodos();
    }
}
